{"ast":null,"code":"export const findContactOrReturnNull = (searchedUser, currentUser, collectionContacts) => {\n  collectionContacts.items.forEach((item, index) => {\n    if (item.fromUser.id === searchedUser.id && item.toUser.id === currentUser.id || item.toUser.id === searchedUser.id && item.fromUser.id === currentUser.id) {\n      return {\n        index: index,\n        contact: {\n          ...item\n        }\n      };\n    }\n  });\n  return {\n    contact: null\n  };\n};","map":{"version":3,"names":["findContactOrReturnNull","searchedUser","currentUser","collectionContacts","items","forEach","item","index","fromUser","id","toUser","contact"],"sources":["/data/messenger.client/src/utils/Contact.ts"],"sourcesContent":["import {UserListItem} from \"../models/response/UserListItem\";\nimport {ContactListResponse} from \"../models/response/ContactListResponse\";\nimport {ContactWithIndex} from \"../models/props/ContactWithIndex\";\n\nexport const findContactOrReturnNull = (\n    searchedUser: UserListItem,\n    currentUser: UserListItem,\n    collectionContacts: ContactListResponse\n    ): ContactWithIndex | null => {\n\n    collectionContacts.items.forEach((item, index) => {\n        if (\n            (item.fromUser.id === searchedUser.id && item.toUser.id === currentUser.id) ||\n            (item.toUser.id === searchedUser.id && item.fromUser.id === currentUser.id)\n        ) {\n            return {\n                index: index,\n                contact: {...item}\n            };\n        }\n    });\n\n    return {\n        contact: null\n    };\n}\n"],"mappings":"AAIA,OAAO,MAAMA,uBAAuB,GAAG,CACnCC,YAA0B,EAC1BC,WAAyB,EACzBC,kBAAuC,KACT;EAE9BA,kBAAkB,CAACC,KAAK,CAACC,OAAO,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;IAC9C,IACKD,IAAI,CAACE,QAAQ,CAACC,EAAE,KAAKR,YAAY,CAACQ,EAAE,IAAIH,IAAI,CAACI,MAAM,CAACD,EAAE,KAAKP,WAAW,CAACO,EAAE,IACzEH,IAAI,CAACI,MAAM,CAACD,EAAE,KAAKR,YAAY,CAACQ,EAAE,IAAIH,IAAI,CAACE,QAAQ,CAACC,EAAE,KAAKP,WAAW,CAACO,EAAG,EAC7E;MACE,OAAO;QACHF,KAAK,EAAEA,KAAK;QACZI,OAAO,EAAE;UAAC,GAAGL;QAAI;MACrB,CAAC;IACL;EACJ,CAAC,CAAC;EAEF,OAAO;IACHK,OAAO,EAAE;EACb,CAAC;AACL,CAAC"},"metadata":{},"sourceType":"module"}